// 项目所有接口存放在 api.ts 下
import request from "./request";

/**
 * 注册
 * @param account 账户名
 * @param password 密码
 * @param nickname 昵称
 * @returns
 */
export const register = async (
  account: string,
  password: string,
  nickname: string
) => {
  const data = await request.post("/loginRegister/register", {
    account,
    password,
    nickname,
  });
  return data;
};

/**
 * 登录
 * @param account 账户
 * @param password 密码
 * @returns
 */
export const login = async (account: string, password: string) => {
  const data = await request.post("/loginRegister/login", {
    account,
    password,
  });
  return data;
};
